package com.upload.util;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/**
 * Created by STARF on 2017/3/25.
 */
public class CopyFileUtil {

    public void copyFile(String srcFilePath, String destFilePath) throws IOException {
        FileInputStream fis = new FileInputStream(srcFilePath);
        FileOutputStream fos = new FileOutputStream(destFilePath);
        int len = 0;
        byte[] buf = new byte[1024];
        System.out.println(fis.read(buf));
        while ((len = fis.read(buf)) != -1) {
            fos.write(buf, 0, len);
        }
        fos.close();
        fis.close();
    }
}
